Skip to content

Conversation

perdasilva
Copy link
Collaborator

Description of the change:

Refactors bundle unpacker's ensureJob method away from named returns.

The logic of bundle unpacking seems to be to use a sha256 hash of the image reference to name the unpack job.
When retry logic is active, it will create differently named unpack jobs.

jobWithoutLabel, err := c.jobLister.Jobs(fresh.GetNamespace()).Get(cmRef.Name)
if err != nil && !apierrors.IsNotFound(err) {
    return nil, err
}

Will always try to get the original unpack job (cmRef.Name will always be the original unpack job's name). If the original job fails (e.g. n/w issue, etc.), it gets cleaned up and eventually this Get call returns a not found. The not found error sticks to err all the way to a return further down the line when the new unpack job is created. This makes the operator crash loop on unpacking the bundle:

  1. unpack bundle
  2. get non existent job
  3. do normal things in ensureJob
  4. return job and not found error thinking you didn't
  5. bail on reconciliation

Motivation for the change:

Architectural changes:

Testing remarks:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

Signed-off-by: Per Goncalves da Silva <[email protected]>
@openshift-ci openshift-ci bot requested review from oceanc80 and tmshort September 5, 2025 18:26
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2025
Copy link

openshift-ci bot commented Sep 5, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2025
@grokspawn
Copy link
Contributor

some unit test failures, but the approach is sound
ping me when the unit tests are updated and I can re-lgtm

@grokspawn grokspawn removed the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2025
@perdasilva
Copy link
Collaborator Author

some unit test failures, but the approach is sound ping me when the unit tests are updated and I can re-lgtm

doh - I tested locally and it passed. Just did it again...man...v0 is the gift that keeps on giving XD

@grokspawn
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit ce2832a into operator-framework:master Sep 5, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants